﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Frw.Configuration;
using System.Configuration;

namespace Frw.Protocols.Communications.Tcp.Configuration
{
    public class CommunicatorElement : Frw.Configuration.ConfigurationElement
    {
        [ConfigurationProperty("key", IsRequired = true, IsKey=true)]
        public string Key
        {
            get { return (string)this["key"]; }
            set { this["key"] = value; }
        }

        [ConfigurationProperty("ipAddress", IsRequired = true)]
        public string IpAddress
        {
            get { return this["ipAddress"].ToString(); }
            set { this["ipAddress"] = value; }
        }

        [ConfigurationProperty("port", IsRequired = true)]
        public int Port
        {
            get { return int.Parse(this["port"].ToString()); }
            set { this["port"] = value; }
        }

        public CommunicatorElement()
        {
        }
    }
}
